interface Param {
  paramName: string
  value: string | number
}

/**
 * 替换路径占位符
 * @param url
 * @param params
 * @returns
 * @author lian
 */
export const replaceParams = (url: string, params: Param[]) => {
  const resultPath = ref(url)
  params.forEach((item) => {
    resultPath.value = resultPath.value.replace(`:${item.paramName}`, String(item.value))
  })
  return resultPath.value
}
